<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>学校信息</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/style.css" />
    <style>
        header {
            background-color: #f2f2f2;
            line-height: 42px;
            height: 42px;
            position: relative;
        }

        header b {
            width: 42px;
            height: 100%;
            display: inline-block;
            position: relative;
            z-index: 1;
            background: url() no-repeat center;
            background-size: 70% auto;
        }

        header b.ic-back {
            background-image: url(../image/ic-back.png);
        }

        header b.ic-check {
            background-image: url(../image/ic-check.png);
            float: right;
        }

        header .title {
            position: absolute;
            left: 0;
            bottom: 0;
            right: 0;
            text-align: center;
            font-size: 18px;
        }
    </style>
</head>

<body>
    <div id="wrap" class="flex-wrap flex-vertical">
        <header class="border-b">
            <b tapmode="hover" onclick="api.closeWin();" class="ic-back"></b>
            <div class="title"></div>
            <b tapmode="hover" onclick="funActionSheet();" class="ic-check"></b>
        </header>
        <div id="main" class="flex-con">

        </div>
    </div>
</body>

</html>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript">
    apiready = function() {
        $api.fixStatusBar($api.dom('header'));
        $api.dom('.title').innerHTML = api.pageParam.name;
        api.openFrame({
            name: 'school_main',
            url: './school_main.html',
            rect: {
                x: 0,
                y: $api.dom('header').offsetHeight,
                w: api.winWidth,
                h: $api.dom('#main').offsetHeight
            },
            bounces: true,
            pageParam: {
                name: api.pageParam.name
            }
        });
    };

    function funActionSheet() {
        api.actionSheet({
            title: '更多选项',
            cancelTitle: '取消',
            buttons: ['切换学校', '学校编辑登录']
        }, function(ret, err) {
            if (ret.buttonIndex == 1) {
                $api.rmStorage('school');
                api.openWin({
                    name: 'entrance',
                    url: '../entrance.html'
                });
                api.closeWin();
            } else if (ret.buttonIndex == 2) {
                api.openWin({
                    name: 'editor_login',
                    url: './editor_login.html'
                });
                closeWin();
            }
        });
    }
</script>
